#ifndef SIGINT_HANDLER_H_
#define SIGINT_HANDLER_H_

#include <signal.h>
#include <assert.h>
#include <iostream>
#include "EventHandler.h"

using namespace std;

class SimulacionHandler: public EventHandler {

private:
	sig_atomic_t gracefulQuit;

public:

	SimulacionHandler() {
		this->gracefulQuit = 0;
	}

	~SimulacionHandler() {
	}

	virtual int handleSignal(int signum) {
		assert( signum == SIGINT);
		this->gracefulQuit = 1;
		//cout<<"SEÑAL SALIR"<<endl;
		return 0;
	}

	sig_atomic_t getGracefulQuit() {
		return this->gracefulQuit;
	}

	void setGracefulQuit() {
		//cout<<"CAMBIO SEÑAL"<<endl;
		this->gracefulQuit = 1;
	}

};

#endif /* SIGINT_HANDLER_H_ */
